<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
    pageEncoding="ISO-8859-1"%>
    <%@taglib prefix="s" uri="/struts-tags"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Insert title here</title>
<script>
	var request;
	//var com = document.getElementsById('comm').value;
	//alert(document.getElementsById('comm').value);

function delete_post_comment(group_update_id) {
	
	request = new XMLHttpRequest();
	//var com = document.getElementById('delete_comment').value;
	//alert(document.getElementsById('comm').value);
	request.open("post", "delete_post_comment.action?group_update_id="+group_update_id,
			true);
	request.send();
	request.onreadystatechange = display_post_comment;
	//document.getElementById('group_wall_post').value = "";
}
	function cool_comment(group_update_id) {
		request = new XMLHttpRequest();
		request.open("post", "update_cool_comment.action?group_update_id=" + group_update_id,
				true);
		request.send();
		request.onreadystatechange = display_post_comment;
	}
	function agree_comment(group_update_id) {
		request = new XMLHttpRequest();
		request.open("post", "update_agree_comment.action?group_update_id=" + group_update_id,
				true);
		request.send();
		request.onreadystatechange = display_post_comment;
	}
	
	function disagree_comment(group_update_id) {
		request = new XMLHttpRequest();
		request.open("post", "update_disagree.action?group_update_id=" + group_update_id,
				true);
		request.send();
		//request.onreadystatechange = display;
	}
	
	function display_comment() {
		document.getElementById('loader').innerHTML = request.responseText;
		//reload();
	}
	function display_post_comment() {
		document.getElementById('post_comment').innerHTML = request.responseText;
		//reload();
	}
	function display_all_updates_comment() {
		document.getElementById('group_main_updates').innerHTML = request.responseText;
		//reload();
	}
	function reload() {

	}
</script>
<style type="text/css">
#comment:HOVER {
	background-color: #E7E7E7;
	border: 1px solid #D0D0D0;
}
#delete_comment:HOVER {
	color: #484848;
	background-color: #C21111;
}
.comment_scroll { width:345px; height:506px; overflow-y:auto; overflow-x:auto; clip-rect:(0px, 345px, 506px, 0px); }
</style>
</head>
<body id="post_comment">
<fieldset>
<div class="comment_scroll">
<table>
	<!-- 
	<tr>
		<td align="center">
			&emsp;<s:textarea cols="60" rows="2" name="post_comment"/>
			
		</td>
	</tr>
	<tr><td style="font-family: calibri; font-size: small;" colspan="2" align="right"><a href="#">Post</a>&emsp;<a href="#">Upload</a></td></tr>
	<tr><td colspan="2" style="border-bottom: 1px solid lightgrey;"></td></tr>
	 -->
	
	<s:iterator value="comment">
	<tr><td height="2px"></td></tr>
	<tr>
		<td width="10px" ></td>
		<td style="background-color: #E1E1E1;" colspan="2" width="330px">
			
				<table>
				<tr><td height="5px"></td></tr>
				<tr>
				<td width="5px"></td>
				<td>
					<table>
						<tr>
							<td width="95px"><font style="font-family: calibri; font-size: small; color: #29262B;"><b><s:property value="updater_name"/></b></font></td><td width="5px"></td>
							<td width="5px" style="border-left: 1px solid lightgray;"></td><td width="225px"><font color="black" style="font-family: calibri; font-size: small;"><s:property value="update"/></font></td>
						</tr>
						<tr><td height="5px" colspan="4" style="border-bottom: 1px solid lightgray;"></td></tr>
						<tr>
										<td height="5px" colspan="4"></td>
									</tr>
									
									<tr>
										<td colspan="4" align="left">
											<table>
												<tr>
													<td width="4px"></td>
													<td id="comment" onclick="cool('<s:property value="group_update_id"/>')"><img src="images/cool_comment.png">
													<!-- <a href="update_cool.action?group_update_id=<s:property value="group_update_id"/>&group_id=<s:property value="#session['group_id']"/>">
													<img src="images/cool.png"></a>  --></td>
													<td width="20px"></td>
													<td id="comment" onclick="agree('<s:property value="group_update_id"/>')"><img src="images/agree_comment.png">
													<!-- <a href="update_agree.action?group_update_id=<s:property value="group_update_id"/>&group_id=<s:property value="#session['group_id']"/>">
													<img src="images/agree.png"></a>  --></td>
													<td width="20px"></td>
													<td id="comment" onclick="disagree_comment('<s:property value="group_update_id"/>')"><img src="images/disagree_comment.png"> </td>
													<td width="20px"></td>
													<td><font style="font-family: calibri; font-size: 8pt;" color="gray"><s:property value="update_time"/> </font> </td>
													<td width="20px"></td>
													<!-- <td id="delete_comment" onclick="delete('<s:property value="group_update_id"/>')"><img src="images/delete.png"> </td> -->
													<td id="delete_comment" onclick="delete_post('<s:property value="group_update_id"/>')"><font color="#E1E1E1" style="font-family: calibri; font-size: medium">&ensp;x&ensp;</font></td>
												</tr>
											</table>
										</td>
										
									</tr>
									<tr><td colspan="4" height="5px" style="border-bottom: 1px solid lightgray;"></td></tr>
									<tr>
										<td height="5px" colspan="4"></td>
									</tr>
						<tr>
							<td colspan="4">
								<table>
									<tr>
										<!-- 
										<s:if test="comment_count>0">
											<td><font color="#504E4E" style="font-family: calibri; font-size: 8pt;">Comments&ensp;</font></td><td height="11px" style="background-color: #535353;"><font color="white" style="font-family: calibri; font-size: 8pt;">&ensp;<b><s:property value="comment_count"/></b>&ensp;</font></td>
											<td width="20px"></td>
										</s:if>
										 -->
										<s:if test="cool_count>0"> 
											<td><font color="#504E4E" style="font-family: calibri; font-size: 8pt;">Cools&ensp;</font></td><td height="11px" style="background-color: #535353;"><font color="white" style="font-family: calibri; font-size: 8pt;">&ensp;<b><s:property value="cool_count"/></b>&ensp;</font></td>
											<td width="20px"></td>
										</s:if>
										
										<s:if test="agree_count>0">
											<td><font color="#504E4E" style="font-family: calibri; font-size: 8pt;">Agrees&ensp;</font></td><td height="11px" style="background-color: #535353;"><font color="white" style="font-family: calibri; font-size: 8pt;">&ensp;<b><s:property value="agree_count"/></b>&ensp;</font></td>
										</s:if>
									</tr>
								</table>
							</td>
						</tr>
					</table>
					</td>
					<td width="5px"></td>
					</tr>
					<tr><td height="5px"></td></tr>
				</table>
				<!-- 
				<font style="font-family: calibri; font-size: small; color: #29262B;"><b><s:property value="u_name"/></b></font>&ensp;<font style="font-family: calibri; font-size: small;"><s:property value="update"/></font>
				<br>
				&ensp;&ensp;&ensp;<font color="gray" style="font-family: calibri; font-size: 8pt;"><b><s:property value="count"/></b>&ensp;Comments</font>
				 -->
				<!-- 
				<table>
					<tr><td width="20px"></td><td><table width="500px" style="background-color: #EBECED;">
					<s:iterator value="group_updates">
						<tr><td height="5px"></td></tr>
						<tr><td><font style="font-family: calibri; font-size: small; color: #29262B;"><b>&ensp;<s:property value="updater_name"/></b></font>&ensp;<font style="font-family: calibri; font-size: small;"><s:property value="update"/></font></td></tr>
						<tr><td style="border-bottom: 1px solid lightgrey;" height="5px">&ensp;<font style="font-family: calibri; font-size: 8pt;"><a href="#">Cool</a>&emsp;<a href="#">Agree</a></font></td></tr>
						<tr><td height="5px"></td></tr>
						<tr><td><font style="font-family: calibri; font-size: small; color: #29262B;"><b>&ensp;<s:property value="updater_name"/></b></font>&ensp;<font style="font-family: calibri; font-size: small;"><s:property value="update"/></font></td></tr>
						<tr><td style="border-bottom: 1px solid lightgrey;" height="5px">&ensp;<font style="font-family: calibri; font-size: 8pt;"><a href="#">Cool</a>&emsp;<a href="#">Agree</a></font></td></tr>
						<!-- <tr><td height="5px" style="border-bottom: 1px solid lightgrey;"></td></tr>  -->
					<!-- 
					</s:iterator>
					</table></td></tr>
				</table>
				 -->
					
						
					
			
		</td>
	</tr>
	</s:iterator>
</table>
</div>
</fieldset>
</body>
</html>